feat: Checkbox 2.0 component - #4208
Merged
Merged
Conversation
8 tasks
pomfrida
force-pushed
the
4191-update-checkbox-in-code
branch
from
November 11, 2025 10:22
d8807c9 to
9e5ed00
Compare
pomfrida
force-pushed
the
4191-update-checkbox-in-code
branch
from
November 18, 2025 11:37
43df467 to
7a34066
Compare
pomfrida
force-pushed
the
4191-update-checkbox-in-code
branch
2 times, most recently
from
December 15, 2025 14:44
10022a3 to
0f95852
Compare
pomfrida
force-pushed
the
4191-update-checkbox-in-code
branch
2 times, most recently
from
January 14, 2026 15:26
a7f7a95 to
bda4228
Compare
- Checkbox now uses Field component for layout and accessibility - Simplified API: removed labelProps and wrapperProps - Added indicator prop for required/optional text - Updated CSS with Figma design values (gap, padding, focus frame) - Added Compact story to demonstrate density support - Fixed Storybook preview to import correct CSS file - Moved CSS entry point to next/index.css
- Checkbox now supports helperMessage for validation feedback - Helper message automatically connected via aria-describedby - Error state sets role='alert' on helper message for a11y - Helper message color changes to red when error=true - Added WithHelperMessage and updated ErrorState stories - Added tests for helperMessage functionality
pomfrida
force-pushed
the
4191-update-checkbox-in-code
branch
from
January 19, 2026 12:59
3e71157 to
ed0b75d
Compare
- Removed error prop as it's not in the Figma design - Users can use data-color-appearance attribute directly if needed - Kept helperMessage for additional context - Removed ErrorState story and related test
Shows how to use data-color-appearance='danger' for error styling
- Default to 'accent' color appearance for checkbox icon - Allow override via data-color-appearance prop (e.g., 'danger') - Helper message stays neutral by default, turns red for danger - Add ColorAppearance type with valid values - Add tests for color appearance functionality
… CSS Token system handles data-color-appearance automatically via --eds-color-text-subtle
- Replace hardcoded pixel values with EDS tokens and future Figma token fallbacks - Simplify CSS selectors by removing duplicates - Move ColorAppearance type to shared types.ts - Add data-density support for Table checkbox story - Simplify helper message color logic (neutral for accent, follows color-appearance otherwise)
pomfrida
marked this pull request as ready for review
January 19, 2026 14:57
eddiman
requested changes
Jan 20, 2026
Icon component has two sizing modes: 1. Without size prop: uses font-size (1.5em) - affected by parent context 2. With size prop: uses density-aware tokens (--eds-sizing-icon-lg) In table cells, the parent font-size is smaller (14px), causing icons to shrink when using the font-size based approach. By using size="lg", checkbox icons now consistently use design tokens: - Spacious: 24px - Comfortable: 20px This also simplifies the CSS by removing manual width/height overrides.
Replaced padding-block + min-height with fixed height from density token. This ensures comfortable density gets correct 24px height (was 32px due to hardcoded 10px padding fallback designed for spacious mode). Flexbox centers content vertically, so no padding needed.
- Remove WithIndicator story (indicator prop still supported via Field) - Remove inline error message from form example (not relevant for checkbox) - Remove data-density from TableCheckbox (uses default spacious)
Changed from opacity: 0.4 on teal to --eds-color-border-neutral-medium (#aeaeae) to match Figma design exactly.
eddiman
requested changes
Jan 20, 2026
eddiman
left a comment
Contributor
There was a problem hiding this comment.
Looks good, but minor changes in which props should be exposed.
- Use data-selectable-space and data-space-proportions attributes - Height now calculated from padding + content (matches Figma 'Hug') - Spacious: 36px, Comfortable: 28px - Clean up excessive comments in CSS
- Add comfortable density padding for standalone checkbox (28px) - Spacious remains 36px (24px icon + 12px padding) - Comfortable is 28px (20px icon + 8px padding) - Clean up stories with dedicated WithoutVisibleLabel story - Fix ColorSchemes story layout - Update index.css layer order to match input branch
- Add argTypes with categorized props (Core, States, Field, Styling, HTML) - Move className to input element via ...rest for consistency - Remove data-color-appearance from public argTypes - Update test to reflect className on input element
- Add Figma Code Connect file for design-code mapping - Organize tests into descriptive describe blocks - Fix import order in stories per conventions - Remove redundant storyName annotations - Enable and add snapshot test
eddiman
requested changes
Jan 22, 2026
…Checkbox - Hardcode color appearance to 'accent' per design requirements - Remove data-color-appearance prop from types - Remove related tests for overriding color appearance
Native disabled attribute already communicates disabled state to assistive technologies, making aria-disabled redundant on form controls.
eddiman
self-requested a review
January 22, 2026 08:23
eddiman
self-requested a review
January 22, 2026 12:30
eddiman
approved these changes
Jan 22, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Implements Checkbox 2.0 using vanilla CSS, EDS foundation tokens, and Field component for layout and accessibility.
Changes
<Field>internally for consistent layout and automatic accessibilitylabel- Label text (renders with Field.Label)indicator- Shows "(Required)" or "(Optional)" after label (not exposed in storybook yet to have 1:1 on design)helperMessage- Helper text below checkbox (auto-linked viaaria-describedby) (same as above)data-color-appearancedefaults toaccentFeatures
data-color-scheme="dark"data-density="comfortable"Usage
Checklist